package com.lwx.leetcode.list;



import java.util.*;

public class LRUCache {
    Map<Object, Node> storeMap;
    Queue<Node> recentUsedQueue;
    int capacity;
    public LRUCache(int capacity) {
        storeMap = new HashMap<>(capacity);
        recentUsedQueue = new PriorityQueue(new Comparator<Node>() {
            @Override
            public int compare(Node o1, Node o2) {
                if(o1.getRecentUsedTime() > o2.getRecentUsedTime()){
                    return 1;
                }else if(o1.getRecentUsedTime() < o2.getRecentUsedTime()){
                    return -1;
                }
                return 0;
            }
        });
        this.capacity = capacity;

    }

    public int get(int key) {

    }

    public void put(int key, int value) {

    }

    class Node{
        int key;
        int value;
        //最近使用时间
        long recentUsedTime;
        ￿￿

        public Node(int key, int value, long recentUsedTime) {
            this.key = key;
            this.value = value;
            this.recentUsedTime = recentUsedTime;
        }

        public Node() {
        }

        public int getKey() {
            return key;
        }

        public void setKey(int key) {
            this.key = key;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public long getRecentUsedTime() {
            return recentUsedTime;
        }

        public void setRecentUsedTime(long recentUsedTime) {
            this.recentUsedTime = recentUsedTime;
        }
    }
}
